import {Sequelize} from "sequelize"

export const sequelize =new Sequelize ({
    dialect:'sqlite',
    storage :'./db.db'
})

export const sync = async()=>{
    let {Blog} =await import ('../model/Blog.js')
    await sequelize.sync({force:true})
    let arr = [
        {
            title:'1122',
            author:'思思'
        },
        {
            title:'3333',
            author:'思思'
        },
        {
            title:'4444',
            author:'思思'
        },
        {
            title:'5556',
            author:'思思'
        },
        {
            title:'6666',
            author:'思思'
        },
    ]
    Blog.bulkCreate(arr)
}